package com.droowa.controller;

import java.sql.SQLException;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import com.droowa.domain.Product;
import com.droowa.model.service.ProductManagementService;

@Controller
@RequestMapping("/searchProduct/")
public class SearchProductController {
	
	@Autowired
	private ProductManagementService service;
	
//############################## 전체제품조회 #####################################
	@RequestMapping("getAllProduct.do")
	   public String getAllProduct(HttpServletRequest request) throws SQLException{
	      request.setAttribute("flag", false);
	      List<Product> list = service.getProductList();
	      request.setAttribute("list", list);
	      return "customer.getAllProduct";
	   }
//############################## Tab 카테고리별 조회 #####################################
	@RequestMapping("allProductList.do")
	public String allProductByCategory(HttpServletRequest request) throws SQLException{
		String select=request.getParameter("select");
		System.out.println(select);
	    request.setAttribute("select", select);
		return "customer.getAllProduct";
	}
		
		
}
